package org.javaymw.springboot.service.impl;

import org.javaymw.springboot.service.BaseSmsService;
import org.javaymw.springboot.service.DingdongCloudApis;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Auther: zhaoxinguo
 * @Date: 2018/9/28 16:51
 * @Description: 叮咚云短信服务实现类
 */
public class DingDongCloudSmsService extends BaseSmsService<DingDongCloudConfig> {

    private static final Logger LOGGER = LoggerFactory.getLogger(DingDongCloudSmsService.class);

    private final String apiKey;

    public DingDongCloudSmsService(DingDongCloudConfig config) {
        super(config);
        apiKey = config.getApiKey();
    }

    @Override
    public void send(String phoneNo, String text) {
        //发送短信API
        LOGGER.info("调用参数：{}", apiKey, phoneNo, text);
        String sendYzm = DingdongCloudApis.sendYzm(apiKey, phoneNo, text);
        LOGGER.info("sendYzm: {}", sendYzm);
    }
}
